package com.sanxiau.dormitory.yang.mapper;

import com.sanxiau.dormitory.yang.entity.Dorm;
import com.sanxiau.dormitory.yang.entity.Dorout;
import com.sanxiau.dormitory.yang.entity.LoginIn;
import com.sanxiau.dormitory.yang.entity.Student;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.Date;
import java.util.List;

@Mapper
@Repository
public interface DoroutMapper {
    /*通过ID查询用户*/
    public LoginIn queryUserByID(int id);
    /*通过用户名查询用户*/
    public LoginIn queryUserByName(String user_name);
    /*通过学号查询学生*/
    public Student queryStudentByStu_id(String stu_id);
    /*通过考勤时间查询考勤记录*/
    public List<Dorout> queryDoroutsByOut_date(String out_date);
    /*查询所有寝室*/
    public List<Dorm> queryAllDorm();

    /*批量设置考勤时间*/
    public int addDorouts(@Param("dorouts") List<Dorout> dorouts);

    /*查询考勤记录是否存在*/
    public Dorout queryDoroutExist(Dorout dorout);

    /*更改考勤时间*/
    public int updateDorout(Dorout dorout);

    /*查询所有考勤记录*/
    public List<Dorout> queryAllDorout();
    /*删除在修改考勤时间之前，当天已经考勤的个人考勤记录*/
    public int deleteAttendances(String hou_id,String dor_id,String check_time,String end_time);
}
